 function loadCities() {
	$.getJSON("http://api.quocity.com/quocity.svc/json/cities?callback=?",
			function (data) {
				$.each(data.GetCitiesJsonResult, function (i, item) {

					$("<div/>")
						.attr("id", item.Name)
						.attr("title", item.SourceInfo)
						.addClass("cloud" + (i + 1) + " abs cloud")
						.html("<span>" + item.Name + "</span>")
						.appendTo("#cities");
				});
				
				loadClouds();
				onReady();



			});
}

function getItineraryItemHtml(item, i) {
        $div = $("<div/>")
            .addClass("toplist_item")
            .attr("url", "www.google.com")
            .append($("<span/>").addClass("name").html(item.Name))
            .append(getRattingItemHtml(item, i));
        return $div;


};

function getRattingItemHtml(item, i) {
        $ratting = $("<span class='rating'/>")
        for (i2 = 0; i2 < 5; i2++) {
            $input = $("<input name='star"+i+"' type='radio' class='star' disabled='disabled'/>");
            if (item.Mark > i2) {
                $input.attr("checked", "checked");
            }
            $ratting.append($input);
        }
        return $ratting;
    }

 
 function loadItineraries(city) {
	$.getJSON("http://api.quocity.com/quocity.svc/json/" + city + "/itineraries/1/10?callback=?",
			function (data) {
				$("#toplist_scroll .overview").empty();
				$.each(data, function (i, item) {
					$("#toplist_scroll .overview").append(getItineraryItemHtml(item, i));


				});
				
				$("input.star").rating();
			});
}
